<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>自定义对象</title>
		<script>
			//创建对象
			var car = {
				//属性
				brand:"奔驰",
				type:"G63",
				price:3500000,
				//函数
				drive: function(){
					alert("开大G去越野...");
				}
			};
			//获取类型
			//document.write(typeof(car));
			
			//访问对象属性
			document.write(car.brand + "," + car.type + "," + car.price);
			//访问属性的第二种方式
			document.write(car["brand"] + "," + car["type"] + "," + car["price"]);
			
			//访问对象的函数
			car.drive();
		</script>
	</head>
	<body>
		
	</body>
</html>
